#include<stdio.h>
#include<string.h>
#include<unistd.h>
int main ()
{
  char bar[102];
  const char* symbol="|/-\\";
  memset(bar,0,sizeof(bar));
  int i = 0;
  while(i <= 100)
  {
    bar[i]='#';
    printf("[%-100s][%d%%][%c]\r",bar,i,symbol[i%4]);
    fflush(stdout);

    i++;
    usleep(10000);
  }
  printf("\n");

  return 0;
}
